package com.uniplaza.app.base;

import com.android.volley.RequestQueue;
import com.android.volley.toolbox.Volley;
import com.uniplaza.app.utils.Utils;

/**
 * Created by Kim on 2017/4/7.
 */

public class Application extends android.app.Application {
    private static Application instance;
    private RequestQueue mQueue;
    private String screenWidth; // 屏幕宽度

    @Override
    public void onCreate() {
        super.onCreate();
        instance = this;
    }

    public static Application getInstance() {
        return instance;
    }

    public RequestQueue getmQueue() {
        if (null == mQueue) {
            mQueue = Volley.newRequestQueue(getApplicationContext());
        }
        return mQueue;
    }


    public int getWidth() {
        return Utils.getScreenWidth(this);
    }

    public String getScreenWidth() {
        if (null == screenWidth) {
            screenWidth = String.valueOf(Utils.getScreenWidth(getApplicationContext()));
        }
        return screenWidth;
    }

}
